Issue #279 update with some features from issue #254 and resolve errors that would occur with specific combinations of documentation flags in template generation.