fixes #5

Filter should be now added to the correct graph if possible. Corrected
also few issues with tests.