The cast of buffered_len to size_t should not be needed (jimevans, issue #36)