IE fixes

Thanks to https://code.google.com/p/ie7-js/