fix php strict errors and more cleanup