Fix tile coordinate computation