Fixes for #1376