Improved command line argument handling