Misc edits and tests
Fixes for nil handling