Everything is set correctly. I've measured the movement using calipers and am pretty damn close for any value I give and zLength appears to be right because telling the printer to move to Z 0 brings the build platform to just the right height.
What I believe is happening is that a check to see if the end stop has been hit occurs while its moving away from the endstop. Since the endstop was never disengaged, it things it has hit the endstop... Does that make sence?
Could you point me to where in the source code it does the homing of the axis. I'm fairly comfortable with code and might be able to understand better what is happening when i read the code.