Move check for non-URLs a little later so doesn't catch out strings.