Trying to track down Phillip's issue
More fixes and a test program with multiple threads