Avoiding some potential NPEs