Fixed a bug in capture_screenshot.py.
Merge.