Adding some long overdue unit tests