bug fix for kv scan, add scan test