Fixes and cleanup for file creations and deletions