Fixing some miscellaneous build problems