Fixes bug 11710 based on review of Daniel Grunwald