Have I missed something or is there a way to ensure that when scanning a library, references to deleted or moved files are themselves deleted?

It is very frustrating to have to delete and re-create a database every time I make changes.

Perhaps there is an option to force proper synchronisation, but I cannot find one.