Fixed hopefully last bug with pattern