Byte count fixed

Fixed the byte count so the correct number of data bits are written into
memory. Everything seems to be working now. I would say that it just
needs to be cleaned up and finishing any misc TODOs