Fixes for #1152