Remove unnecessary traces.
Create PNG file with temporary name and rename it after closing.
Create PNG file with temporary name and rename it after closing.
Fix some warnings and remove unnecessary traces.