fix memory leak in smart_placement (with area_list_remove) and fix the algo