Fix race condition in clearing leaked controls.
Fix some uninitialized variables discovered using valgrind.
Don't change the scaler if it is over-ridden for testing.