fix spans for if expressions, fixing IDE bugs #503