Added exception wrapping for streams
Fix import