Some bug fixes and added filtering interface.