Add licenses and minor fixes