Fixing model reaction code