Fix getMethod

In order to make `getMethod` work, `methods` property have to be indexed by method's name. Also added `array_values` to `getMethods` method to save its behaviour.