Calculate application sizes correctly
Thanks to Pierre-Hugues Husson for looking at my code and finding out
that the application sizes were not being calculated properly!

chenxiaolong