Upgrading code for compatibility with new schema.