applied hlint suggestions, corrected argument parsing error