Fixed #141
The error was cased by the 'None' value of the 'template_path' from

template_dir = os.path.dirname(template_path)
The previous changes are incorrect. The previous code log all the resources in the limit_to as not found and generate attribution on all the resources that are not in the limit_to.