Fix 3.6. Closes #3061.