Fix undeclared variables