Bug due to non-closing of a StreamWriter fixed.