Fixed some issues with pointers and crashing. Cleaned up some code in tmxloader.cpp