Fix for getting correct profile name in cases when source path contains dot(s)