Tweaked tile engine code

Fixed some minor issues