Fix for #582