Fixes for possible zero-length arrays.