bugfixes in refdata creation