Backported some changes from 04-JUnit.