Fixed bufferToPage, pageToBuffer and tested beginPageWriteThroughBuffer.