Fix pattern matching for rank 2 constructors, and add an example