Completed tests & fixed some bugs.