Buggfix and JS fix