Bug fix and improvement for JUnit runner