Fixes for encrypted secret storage