makes a few small changes to buffer sizes and error handling