Fixes to crypto