Added license information and bug fixes