Scoping problem cleanup