HG-332 Fix links being returned when they should not