Changed to through2 and added test to check whether errors are emitted