Fix some nasty hangs if garbage were passed.
Fix some nasty hangs if garbage were passed.

Noticed by:	Emmanuel DELOGET <pixel@DotCom.FR>
Remembered by:	msmith

jrobhoward/SCADAbase,jrobhoward/SCADAbase,jrobhoward/SCADAbase,jrobhoward/SCADAbase,jrobhoward/SCADAbase,jrobhoward/SCADAbase,jrobhoward/SCADAbase,jrobhoward/SCADAbase,jrobhoward/SCADAbase,jrobhoward/SCADAbase,jrobhoward/SCADAbase