improve tests and be a bit more efficient at dealing with errors in the buffered version