Add test for bug reported in forum.
Fix failing JUnit test.