Change branch implementation to wrap condition