Fix some small bugs

Adds some better quoting and conditional assignments