mem_split(): Fixed "no selection no memory" bug