Bugfixes in JS_dismat