Fix issue with results that are larger than buffer size.
Also fix issue with the first command.