Fix for #596