Fixes for #1217