Some tweaks to deal with IE9+