Fix for setting selected attribute.