Some more NPE fixes