fix waterfall command checks

Fix checks for commands using intersection & distinct in order to search the commands throughout the entire arguments (any order)