fix #156 - fix JavaScript errors