Fix bug in else side of nested ifs