refs #505 - fix freemarker error, and JS redirect after login