Fix up php 5.3 problems and remove other warnings/notices