SCRIPT_NAME/PATH_INFO fix, and media type prioritisation.