Fix handling of upper bounds.