Fix end of key index file