Some corrections

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