Fixed some memory problems reported by Andy.
Use stable_sort to sort keys in client mutator buffer