changing FileModificationRegistry so it increments file versions for both new and existing files and fixing NPE in tests