Added unsigned int16 output stream;
A few optimizations.