Fix a number of bugs in the if expression among them fix issue #48