Fixed incorrect coordinate calculation.