Several crashes related to wrong frame index were fixed.