speed and stability fixes in malloc