fix uncommitted in a better way
fix intermittent failure
add max_buffer_size

Large files would blow up with OSError no 7 (Argument list too long)