Fix tests

I've made a few small changes to get tests passing.