More fixes and adding some support for ie8.