Fixed incorrect quadrant calculation.