IE7 fixes

Not sure why I never submitted a PR for the first commit here, but that's useful, too.