scanner bug fixes