Fix a memory leak

+ syntax changes
+ an optimization
+ license clarification