Added help dialog and improved error handling of input arguments