fix stream leak on HEAD. Closes #91