Misc

Checked with pyflakes
Added source code encoding declaration
Closed open files