remove some useless casts, recheck some type issues