Fixed bug where screen size could be miscalculated