Fix bug in proxy method invocation

Add unit test for this case