Legal licensing and small fixes