Fixes to make findbugs happy about null handling.