Merge "Fix bugs in user restriction migration" into nyc-dev