Fixes suggested by Stefan.
Posting on Java 8.