Scaled coordinate causes segmentation fault