Multiple changes and fixes

Using the "inspect code" from pycharm i have notice a lot of problems or non pep good practices in the code....