Fix tile coord calculations