Improved argument handling and error messages