Take into account class hierarchy while comparing parameters