Fix template issues