Fix size calculations and format