Fix autosize and view restore.