Fixed some errors. Added locks for threads to DataQueue, added threaded test for it.