Fixed int size problems to get bitstream working