New license model and some bug fixes for directory resolution