Port fix for #918