Add copyright
Fix global generation
Cleanup