Fixes for #1258