Fix logic around NOW/BEFORE state machine