correctly remove characters for filename

This is follow up of #26. I've forgotten to fix character removal for filenames. 

This PR fixes it + test case