Fixed scope issues.