more npe fixes