Fix encryption crash