Correct gem's operations for multiple instances of an optional clause