The "slim" version of the curve is due to some error when the z value crosses the x axis to another quadrant.
This may explain the problems with programming the endpoints. (?)
The regular default version of the curve is correct. :-) (?)
The elliptic integral functions are not working correctly with this sign reversal. (?)
The first "stable" release of the programming language Julia was released last week.
It has code to compute E(phi,m) for phi > pi/2, which adds pi/2 to phi, divides by pi, then applies the floor function. Modulus is used also.