some fixes in frontend js
https://github.com/altocms/altocms/issues/149