Add license test, fix some broken cases