bugfixes with refdata creation