Fixed bug where file was read as buffer instead of string