Fix bugs in tests with encrypted path