Updated logic to match Rx.NET
Refactored TakeUntil to use TakeWhile.