Fix more bugs that we found for reverse scan, it may crash the system