Fix "dead object" errors in domplate