absolute paths on dirname calls

This is minor, but I made all paths absolute to be consistent with the rest of the script in case people have strange aliases on dirname (which I've admittedly never heard of...)