Fixes for code builder
Added optimizations for if/else/switch/do/while constructions