Various corrections for plots and flagging routines