Updated the unit tests and fixed some more weird things