Minor improvements for Misc/Template