fixed references and string conversion for file stream