Some corrections

Added some semicolons, declared some variables, url-encoded selected string, fixed a missing parenthesis in a RegExp, use https on https pages and some other minor stuff.