Add tests for second order deformations.
Some code fixes found by testing.
Update testing data.
part of #64.