Minor access violation exception fix