python3 and macosx fixes