[#141] Using path.basename instead of regex to make code more portable across various OSes.