Fix for createkey, was incompatible with crypto object