Fix incorrect assertion when parsing expressions