Fix old tests that do not run anymore.
Fix race condition in FileCacher (closes #198).