Improved error handling. Disposed of the FileStream correctly in Tester.