Fix some NPEs... not sure why this is happening, but trying to be on the safe side, anyway.