Fix encryption of key (hopefully)