Fix encryption exception