Fixed division errors causing problems with certain screen sizes