withType = true should convert to buffer too.