Optimization of %STREAM-READ-FUNC and some minor changes