Do not remove non-slash first character of module

The removal of initial slash in the path was error-prone and always removed first character from the string, even if it's not a slash. I replaced that with a small improvement to the cleaning regex.

Fixes #1106