Test fixes

this gets tests to work by fixing some bugs

I should note that `npm test` says `0 tests complete (2 ms)` for me, but `npm run test-integration` runs stuff