Improved error handling for missing arguments