compiler/libec: Added missing casts in generated code from pass2