According to @zxiiro, removing some of those deletions are what caused my seg faults earlier. I'll test out removing this later though.