Limit size of BFS as well.

Guess that my committing was actually faster than my thinking in the previous commit.