New unit tests

Extended the unit tests and fixed minor bugs