Fixed a bug using proxies with the JDK API, found by DanielAdolfsson
Merge pull request #332 from korinth/master

Bugfix for JDK API, using proxies