PEP8 improvements and a fix for adding URLs

Just a couple of comingled changes: this resolves the issue when adding new URLs, and makes a few changes to variable names for consistency.