Scopes of some elements changed to be correct