Add missing FilterFactory tests and add security check for document type