Fixing auto height bug with the help of Tim.