Some cosmetic changes and freeVars function.