Clean up tests/code

Lots of misc fixes. Had a bad test, refactored some stuff, handled
missing supply point issues better.