Fix coordinate type to avoid invalid cast