BUG: avoid creating a 0-len chunk