Various changes, added test classes