Fix inner size calculation