bugfixes for stream callbacks