Small changes and a bugfix

Inserting environments while the region is active did not work for
quite some time!