more copypaste tests
fix crash with parts and ties; more optimizations
regression test fix
Merge remote-tracking branch 'upstream/master'