add int cast for BooleanExpr, fixed StatementList construction causing recursive calls, and cleaned functions