Bug fix and improvement for the Metadata.py example.