fix bugs about int type and remove several warnings