Fixes for NullPointerExceptions.

Fixes for two new NullPointerExceptions which showed up in the log for v2.1.0