Convert string to C-string for logging

Fixes #1245
Merge pull request #1246 from dorkster/fixes

Convert string to C-string for logging