Bug fix on argument checking