Issue #279 Fix a few bugs and missing files from template reorganization.