Fixed Deques bug of exception on empty children hierarchy.
Fixed tests.