Some cleaning, fix valgrind errors
Try to solve valgrind errors
Make sure we can parse mongo uri