Fix bug with autosize