Bugfix. Actually raise a ValueError.
Remove code that gets no execution

y1 gets explicitly reshaped, hence there is no reason to check for
its shape. Remove equally useless commented out line.