Add destructors for Elements and Knit, and a signal when changing a pattern
Fixed segfault

The pattern was deleted for each trapezoid => double free
Format code and fixed typo