Updated JUNIT tests and fixed bug #11