Fix twist method.
Add twist test.
Merge pull request #85 from PencilCode/fixtwist

Fix twist