Added license (GPL), fixed debug printing