Fixed some (potential) NPEs