Added a license and small bug fix