some optimizer changes
Merge branch 'optimizer' of https://github.com/iburinoc/Cube into optimizer