I think you still need to fix the issue where you only call the monitoring inside this if statement. The nonlinearities themselves can omit target-based monitoring channels, but you shouldn't omit all of their monitoring channels if there are no targets.