Fix issue #576

Thanks @synapticarbors for the report. This fixes the error.