Fix variable visibility