Fix: pattern not matching in case statement