Added new tests, improved S4 interface