1. -Fix some bug and memory leak.