Fix IE9, add tests