Small JS bug fix, precompiling templates