Fix issue reported in 4006

fixes #4006