Fix detection of mismatch between array and map