Removed redundant code from test script and fixed filter