fixing index file merge issues, and cleanup