Fixed displaying of selection boxes, fixes #762

Tested in Chromium and Firefox
Merge pull request #775 from cmfcmf/patch-7

Fixed displaying of selection boxes, fixes #762