Some python3 compatability fixes