Various fixes for versioned templates