FIX: check_memory() in test_functions now logs details