Fix travis environment
Handle which errors properly
Add test for writeToStream without stream argument