Fixed bug with restoring inputs.