fixing some errors with JavaScript filters.