Add filter functions
2 bug fixes