Added a bunch of unit tests