Detect wrong component

fixes #23
If you are going to touch this, I'd appreaciate it transformed into

```perl
my ($self, $v, $after, $visited, $active, $stack, $depth) = @_;
```