More tests/more fixes thanks to having a test suite