Add missing use for dirname.