Fixed checking for failures and outputing
Merge pull request #1 from karolsojko/fix_output

Fixed checking for failures and outputing