Fix template deprecatinos and ruby syntax