Fixed variable scope issues