Changed how it checks for memory.