Minor fix to encryption