fixed some moar nasty NPEs