Attempting to fix Math.atan2 bug.