Fixes a bug in transition guard logic