Found a bug and added a failing test
Fixed a bug in receiveWhile