Fixed main build errors.