Fix many bug and add some library