Generating error for  #3357

Generates an error if "out" matches one of the inputs. This should be good to avoid returning wrong results till the bug itself is not fixed.