Some light bugfixes. I tried to use pylint as static code analizer and to to avoid the most bad messages