fix bug in reading multi-byte integers