Fixed bugs in missing js from template