Backported changes from DartVoid repo to DartTemplates repo