Fix to return -1 if stream is finished (thanks to tomas.lazaro@autodesk.com)