Fixes for #1346