Fix handling on intrinsic folding, this closes #118.