Small changes to make template loading work