Fixed some errors with new tile func