Miscellaneous fixes to allow successful build