Added bytes field and fixed bugs