Reduced dirname() function calls.