Fix issue when expanding a path