Improved file-handling in TestManager.