Also fixes the less serious problem of buffer overflows in emulated memory when BufferOutSize is less than 2.