Added `ReplaceNAsWithFactorLevel` function