cleaned up everything but one stubborn unit test, squashed a few minor bugs