add O2 for gcc and fix uninitialized warnning at ts modules