Correct detection with negative margins.
Update minified version of script.