Converting non-strings to strings and removing trailing/leading spaces for template variables.
Fixing mg_docgen script and MG_DOCGEN routine to pass root path correctly. Also giving better error messages for configuration files not found.