Fix some PHP warnings on post save