Improve type->contract error messages