#3827: removed potential recoursive stack overflow, removed potential race condition
#3827: fixed
#3827: test added
Merge branch '3827_removing_of_dependencies'