Port fixes for #1614