Fix issue #130 and JUnit/Javadoc improvements

Can we do this without injecting such long delay into the test? 10-100ms might be acceptable.