Fix for #411

@adriancollier Could you please code-check?