Fix use of int for buffer sizes