Improved schema update code