change some int to long
Clean all warnings