More constant folding improvements. Issue #19