First part of fix for ticket #2330 , this avoids the traceback