Fixed a bug that made the script unable to locate the templates dir if
not run from the same folder.