Fixes for #1289