Changed pattern matching for case statements