fix type
fix some types and unnecessary casts
remove the expression parts, which are always true