Fix a bug in DeformationTestCase and make some other small changes