Fix mongodb issues