merged antonios's bufsize fixes