Some more license fixes and refactoring.