Fix little bugs to support IE8