just some cleanup to make jslint happy!

and removing unnecessary typeof

````
if (typeof activeEditor !== "undefined" && activeEditor !== null) {
```