Fixed warnings about undeclared variables