Some python3 compatible changes