Fixed template print functions and exceptions

Also removed old/dead files