Fix almost all build errors