Fixed an issue with using a foreach inside a conditional scope
Updated a comment