Download plugin: bugfixes and a bit of PEP8