fix various minor issues reported by static analysis remove redundant php closing tag from several more files