Sure enough, putting the config template expansion in a handler isn't a very good idea.