Fixed a bug caused by the fact that intersecting rectangles are possible to appear since some moment