Fix incorrect serialization state after loading

Fixes #13861 

Self-contained gist (tested on ruby 2.0.0-p353): https://gist.github.com/hundredwatt/8668163

Exception:  `TypeError: no implicit conversion of ActiveSupport::HashWithIndifferentAccess into String`