fix detection of overridden methods

fixes #367.