Several fixes to AOL and tests

Why is tmp_data being allocated on the heap now?