Fix for TRQ-1447: Deadlock in server under load...
Fixed compiling error.
Fix up some of the unit testing code.