Fix coordinate handling