Fixes to bring this monster up to date with a working build