Fixed for hopefully the last time.

It looks like things are finally working. I think that the "roundoff error"
issues I've had in the past are really problems with my algorithm in the
xshift function. Also, the nonaffinity functions were wrong after all.
Hopefully everything is working as it should.