Fix possible NullPointerException
Pack schema updates in a transaction