Misc fixes. All tests passing again.