Fixed a bug in _add_realizations