FLINK-1276

Fixes FLINK-1276
Is this correct? Does the second condition subsume the first?