fixed crashing when trying to load/save map.

my stupidity got the best of me.
a sad day for my honor. It suffered much.