Test and fix handling of zero-length entries