Remove unneeded `dirname` calls.