Some bug fixes and tweaks for IE9