Add local_logfiles.py template. Fixed a few other bugs.