Tidied. PHP5 updates/fixes.