Added some optimizations to expression VM generator