More shadow.py code cleanup.