Fix several bugs under IE8