Improved path and extension handling (TUI-40)