Improvement to dictionary-based comparison tests