Operation take leaks errors

The take() operator improperly propagates an error from its source after the count has been exhausted.

Test cases exhibiting the bug attached.