Another try to fix pattern matching