Inncorrect 3D ray created when clicking on the extreams of window?

I have run into a bug that I am not sure how to fix. When I click on the window the point in 3D space does not map directly onto the click in the x-axis of the actual window. The discrepancy between the clicked point and the actual creation of the ray in 3D space increases proportionally as you get farther and farther from the middle of the x-axis in the window. The y-axis works fine, it is just the x-axis.

Here is a picture of squares being created in 3D space where I click the mouse. I clicked only on the edges and moved around the window. (some squares look like hexagons because the camera angle is pointed down, but that is not important, the gap on the left and right is)

Here is the code I used to create the ray in 3D space from a click in the window:

GLfloat winX, winY; // clicked coords on the screen
GLdouble near_x, near_y, near_z; // position of the mouse on the near view plane
GLdouble far_x, far_y, far_z; // position of the mouse on the far view plane

I found the problem, it was the aspect parameter, only in a different place. It was in the 3D initialization (as apposed to the 2D initialization for the HUD), so it did not mater that this code was correct (aside from the width/height, height/width thing), the aspect would always get overridden.

To anyone who has this problem, check ALL gluPerspective's throughout your code, they can over write each other.