Restored ddof for non repeat_weights, handle types better