Fix for bug 399556

https://bugs.eclipse.org/bugs/show_bug.cgi?id=399556

Also, ensure all test cases pass.