minor fixes, mongodb writer