Automark: remove global vars, simple search, disable plugin while selection

Some optimizations and little bug with selections