Some JavaScript changes, related to #169