Minor code cleanup; renamed a couple of locals