Moved auto settings opener to the part of the code which is only run when the page has completed loading.