LILY-1206 Fix mutationconditions logical error

Fix a logial error about when mutation conditions were checked, making it unusable for cases like incrementing counters. Added testcase illustrating the (now fixed) problem.