Fix PHP notices

I fixed this in my version and thought I'd share it with you. Test with debug enabled to make sure no other notices are showing. I whipped this up without thorough testing.