Corrected templates js imports. And js bugs.