Minor fixes (partial)

Previous merge caused a string to become an int. This partially fixes
that, but there are some other broken portions. Committing so that I can
continue to work on it with a history of what I've done so far in case I
need to undo.