fixes trac issue #4220