Fixing tests

Due to the refactoring the tests broke, so we fixed them
Work credit: thhughes