Corrected some pointer checks