Fixes #2490 -- adding guard-style if blocks