merged a few changes from CE