Fix #2151
Wrap up #2151