Remove vanilla references from javascript, also fix calls with empty template

Ticket: #5973