Added testing for the corner cases of traversal.