Local variable cannot be accessed inside conditional which is inside a s...

...elector. Fixes #1265