Fix argument checking