Fix python3 encoding issues (happens on some systems)
OSX build: Fix architecture detection