Fix bug with interpretation of ActiveBasal events

The code had inverted the meaning of "current" and "previous"