load-datasets: fix for max_count parameter
load-datasets: fix crash on last datasets imported