Fixed bugs pertaining to byte buffer

more needed to work