Fix incorrect buffer size math