Fixed crash on deleting last frame.