Autosize Fix

Fixed a bug in the autosize code.