fix marco check_and_expand_array