Fixed checking for failures and outputing
Merge pull request #3 from cometcult/fix_output

Fix output so it works in case of failure