Fix the memory detection