Fix name deduction if the source ends with a /

Fixes #26