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

Looks to be a regression from the array work, I added a unit test saw that it failed then fixed the issue.
Also did a little bit of cleanup work where some tests were failing.