Fix incorrect reference to lastPathComponent