backport simle fix for #165