fixed most of the JUnit tests