fixing build errors from patching