Fix for #516