Fixed nested using statements

the nested using statements could result in the same stream being
disposed twice.
Improved logging information