Fixed modal box scroll

Scrolling was sometimes wrongly disabled. The top margin was not taken into account in the calculations.