Fix buffered channel implementation