Revert "Fix extension parsing for paths with a dot in the directory - close #1755"

Reverted because it's causing a blank startup. More investigation required.
This reverts commit 5f8009cb3494dedd1e9ad171ee7b507ac4708d65.