Various fixes from review.
Fix inverted equality.
Test in oracle and openjdk