Make the unittests pass

There is still the problem that 2 unittests fail. The ones regarding logging out of users.