fix #379 TemplateCtxt.getDomId does not support integers.

Closes #380.
fix #361 for autocomplete freetext

Closes #362.