Fix buffer error
Refactor to three lines for buffer to string conversion.
Requires 'fs'.