Replace invalid filename and path characters
Fixes #9