Minor code fixes

- added missing semicolons
- removed duplicate var declarations
Fixed resize event handling

- when calling .off on the window it should not remove all handlers,
only the one set by the plugin