Fixed the tests for the changes and fixed a bug.