Improved stringmap to support strings with null characters