fix %fks and %references