fixes #310: properly recognize class methods