Fixed problem with Index having duplicate keys. Index is now written
after a directory event is performed.