Fix for previousSibling not defined when pasting patch review

This is a quick fix for #223. There is a more fundamental UI issue to be solved (below) but this is a quick fix/patch for the immediate bug.

Behaviour spotted while testing/working on the fix:

* You can double click a line of code and you are still offered a comment box to nowhere
* For multiple lines either individual click click click (and then click click click the same lines to unselect) or click and drag several lines and click and drag the same lines (or any combination) and you still get a comment box to nowhere

So the real fix here is probably to hide the comment box if there are no currently active lines but I don't have time right now to dig that deeply.