Fixed bug where bytes were sometimes zero.