(refs #12) Fix bug, file is not closed if fail to output report
(refs #12) Create test of following method

* main