Fixed bug of type checking for if expression