fixed errors in Heines' filter javascript