Fix default scope being overwritten. Closes #2087