properly handle 0-size and 0-count fields