Fixes #478.
Added null check before creating instance proxies.