Fix chain encryption (#27)