fix some problems with target auto-scroll