Fix pattern-matching on functions.