Fixed first-time registration of sql_patches and possible fix for 'Cannot resolve...