Fixed some mongodb issues