Fixed some dimension crashes

and a potential crash with Alternate Terrain Generation