fixed bugs in pre-filter, thanks J.Gerling