fix a few quirks, regularize buffer size to be stored as uint