Going over code with Arun; fixed a few byte-error bugs