Fixed infinite loop on extremely narrow screens