Fixed errors in streamhandler