remove global
callback correctly
return stream so we can stream.end()
Merge pull request #17 from ralphtheninja/master

misc fixes