Cleanup buffer size calculations.