Fix issue where present_optgroups could break user state