Remove clunky asInstanceOf calls in CommonProxy

Thanks to code by @ChickenBones