Type checking of expressions