Fix for pattern matching issue #18