Throw error if invalid args.