Fixed up some scoping.