fixed an issue where using atoms or binaries for strings was failing to encode