Fix filter function in CLI utility.