fixes for sign and encrypt