Fixes for #2236