Weekly update. I added a few NULL pointer checks