Bugfix: Respect JsConfig.TreatValueAsRefType<T> behavior

More information: http://stackoverflow.com/a/20344936/541420