Small oversight... parts[1] could be undefined, so we need to:

    (parts[1] || '')