Fixed min and max size calculation. Borders should now be drawn at the
appropriate size.