Also get the dirname here. It is used above and below.