Added license and fixed #2