Fix failure to update peak on changing gain (#2286).