better buffer handling for string conversion
fix small memory leak
remove unnecessary increment
improve error handling for hash calculation
fix more small memory leaks