Fix #28. Write bad result to output when minimize is failed
Merge remote-tracking branch 'origin/issue-28'