fix problem with zero-length blocks