Improved the hash for delegates

Modified to take into account the hash of the target object when the
delegate is an instance method.