Fixed error on mouseUp, if selection is null

Sometime selection is null, e.g. on click on img.
Merge pull request #68 from medhi/patch-2

Fixed error on mouseUp, if selection is null

Thanks!
Fixes #79
Fixes #80
Minified files