some fixes, (that's why I sometimes don't like python