fix problems in javascript library