fix some errors in editing/highlighting