Replacement for #3940