Partially fixes data integrity bug.