Data consistency fixes