Before this commit, the pattern was deallocated with the wrong size that created a huge memory leak.
Closes #103 (closed)