various debugging / cleanup for grid prune script