Begin fixing unit tests, along with some bugs.