Fix some NPEs