Fix the condition of the static if working around deprecation warnings.