Add further tests/update test mocks/fix some bugs