Optimizing filtering by status.

Repeatedly calling erase() is an O(N^2) operation.
The erase-remove idiom changes this to a linear operation.
Removing associated fixme comment.
Simplifying return logic.
Fixing a warning.