Fixed scope and race condition for scrollbars.