Fix build failures (most of them anyway)