librat build fixes