Add IE7-8 workaround & cleanup variable declarations.