Fix for #512