Fix path basename, thanks @ex0ns