Cleaned up the worldgen code to make another bug less likely