fix bug in setRefOutput - joint number was missing