* make base directory include dirname for easier debugging
* fix template