Fix issue with links with subdirectories being truncated