Fix optimal system size calculation