Fix ordering of user-agent classes. Issue #808