Add filter validation.
Add more validation.
Some cleanup.