Fix bug in main.lua which made the game crash on startup