Improved and extended mem binding.