For consistency, use [ rather than [[.
Use function validate_merge_type to check $MERGE is sensible.