Couple of suggestions...
Don't change the UDFs at all, move the cerror line back into the top of your script immeditately following the printerlist line.

The code you provided still would only poll your pc, so unless I'm totally missing something here, can you please provide the code that you are using when you are polling other pcs, since that is when you are getting the errors.