Nearly working except for template calls.