Fix handling of relative links