Add more sophisticated buffer closing.
Adjust mapping in README.