improving type checking on Chunk.add