Fix syntax error and bad variable reference.