fix bug in the return value type 'db' record data
remove debugging statement
fix bug in has_next where the read may overrun the buffer