Added diff length check.