This closes #4012