Improve data parsing.

- Avoid parsing if data is an empty string or buffer.
- Parse buffers.