They were desperate to fill that position and a lot of players were tried because of that. Not to mention Rahul's reluctance to bat in the middle order. Remember Kohli giving his no.3 spot to Rahul in the England series and after the flops there he was duly dumped. He go into the WC luckily on the back of his IPL performances. I think after the WC, they will try him at 3 and Kohli at 4. That should solidify the middle order with Dhoni retiring
That will be the best thing to do! Kohli at No.4 is ideal for his style of game (picking gaps & running) + the solidity needed for Indian Middle order! He will avoid those aerial shots which got him out this world cup! No.4 in all formats is the best thing for him (also he has some issues with new ball... But in SC conditions he can come down at No.3 if the first wicket falls too late!)