Add and remove debugging printfs.
Add tests for getIntercepts, and use those to fix (most of) the bugs in it.