Fix formatting. Follow GNU Coding Style
Fix exit status to work with automake
Add support for Redirection