Fix of #SPC-667 and #SPC-668