Mesh deformation and various bugfixes.