Use raw strings for keys and values instead of zero-terminated strings
Avoid closing database more than once