Fixing compile error on linux and crash due to mem pool