Fixed a bug in the logic to set amplitude to 0.0 on flagged data.