Fixed MongoDB initialization