fix sorting of undefined values in memory connector

undefined values should be moved to the end. The current sorting function returns 0, if a or b is undefined.