IE8 compatibility and general improvements