Fixed local thread test. The thread wasn't being joined before checking the error value.  So, the error value was being checked before the query had a chance to complete.
Cleaned up imports.