bugfix in DiffFunction