Fix rare case of invalid url and general cleanup/linting.