Some small fixes for 0.5

Two problems with javascript resolved. See individual commits.