Handle multiple control dependencies in a more sophisticated (and correct) way