Fixed a couple of NPEs