Fix NPE + Assign encoding + (Try to) work nicely with nodes
Merge pull request #74 from cpf/master

Fix NPE