add license & misc fixes