Fix argument logic and syntax errors