Added fix to deal with MethodInvocation without an object in front of it and also an extra check to compare Method objects.