Fix incorrect asserts in unit tests.
Ensure required temp directories are created on install.