Fix char count incorrectly used as byte count