Fix coordinate conversion issue