Some fixes for graph_all_periods.php