Fixed dispatching of overloaded functions

Before all overloaded functions were treated as methods. They aren't anymore.