Added support for jemalloc, minor fixes