Restoring instance state
Fixed bugs with default selection and instance state restoring, cleanup