fix block generation for nested ifs