Fix oops in the project detection for state directories