Improved creation of test file