Fixed file writing in saveGame