Added type checking for the conditional expression
on ifelse's and while's