Updated template
Misc small fixes