Fix 2 possible NPEs

Signed-off-by: Ferry Huberts <ferry.huberts@pelagic.nl>