Add more pointer checks