Bug fix in unite()
Optimizations for Qt 4.7+