Added error handling for too few/too many arguments