JUnit fixes and bug fixes.