changes to fix decrypt check, among other things