Fix for PUB-256. Forgot 2 more null checks.