Removed most PHP warnings