Cleanup to fix compilation errors and other unstable bits so we can merge this branch for the UI work