add gpl license, various small fixes