fixes a bug involving proxies and custom type handlers