Added possibility to overwrite app_dirname.