bug fix + some small fixes

i ran the pycharm code checker over the code and fixed some small issues plus that bug in os.path.join() call.