Fix bug in reshape method in JS worker