Added fix for #397