Concerning #689 and #172: Added constant folding for Constant<> class