Fixes bug with pattern matching of triple pattern.