Check integer overflow before arithmetic operation

Because overflowing is undefined.
[Linux] Fix double click
Check type before unmarking

Fix CC#1764
>> unset 'blk protect/deep 'blk
;crash