fix a minor bug in autoeditstrategy and add tests