Added support for categories and codes.

Focus input on selection and fixes bad scope definition.