Fighting500

I'm putting here the various fixes. Or do you prefer one branch per fix?

(Don't look at the "pep8" commits, they are only spaces cleaning.)