Fix for non-intuitive scoping issue with IE7