Merge the SaveStructures.py script from master