Fix for #565