If no external layers are defined, pokydirname was not set. Rectify this by taking the be.sourcedir as the pokydirname if possible.
Created on behalf of Olaf Mandel <o.mandel@menlosystems.com>, who found the issue and created the patch.
commit 3752641986058806c464c4eb155732baf4dbaff7