change handling of or-patterns (closes #2508)