Fix project environment reference pattern matching