Reverted last two changes as they didn't fix the corruption issue.