fixed onRestoreInstanceState crashes

Fixed several crashes in onRestoreInstanceState functionality for several widgets and components.