More php 5.4 notice fixes and errors