Updating 'PortableUserAgent' with the latest changes (warning: buggy code)