Completed some unit tests and fixed some minor issues