Update for cross-compilation
Fix a bunch of party corruption

Very much thanks to Rawng for finding this bug and most of the solution.
Do shared visibility more scalably