Added more checks to libFilter