properly detect scope from provided project (fixes issue #1769)