Added missing mutex && added a test for mpool