Add error output to main.c
Merge pull request #364 from xVin/Add-error_output-in-main

Add error output to main.c