fix some bugs on mips generation