minor php compatibility issues, and a slight improvement to the Upload base class